import java.util.LinkedList;
import java.util.Queue;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Du Zhengchi
 * Date: 2024-04-09
 * Time: 20:29
 */
public class Test {
    public static void main(String[] args) {
        TestBinaryTree testBinaryTree = new TestBinaryTree();
        TestBinaryTree.TreeNode root = testBinaryTree.createTree();
        testBinaryTree.preOrder(root);
        System.out.println();

        testBinaryTree.preOrderNot(root);
        System.out.println();
        System.out.println("======================1=======================");

        testBinaryTree.inOrder(root);
        System.out.println();
        testBinaryTree.inOrderNot(root);
        System.out.println();
        System.out.println("======================2=======================");


        testBinaryTree.postOrder(root);
        System.out.println();

        testBinaryTree.postOrderNot(root);
        System.out.println();
        System.out.println("======================3=======================");

        System.out.println("====节点个数====");

        //System.out.println(testBinaryTree.size(root));

        testBinaryTree.size2(root);

        System.out.println(TestBinaryTree.nodeSize);

        System.out.println("====叶子节点个数====");
        //System.out.println(testBinaryTree.getLeafNodeCount(root));

        testBinaryTree.getLeafNodeCount2(root);
        System.out.println(testBinaryTree.leafSize);

        System.out.println("====第K层节点个数====");

        int ret = testBinaryTree.getKLevelNodeCount(root,1);
        System.out.println(ret);

        System.out.println("====求树的高度====");

        int height = testBinaryTree.getHeight(root);
        System.out.println(height);

        System.out.println("====查找某个值====");
        TestBinaryTree.TreeNode retN = testBinaryTree.find(root,'E');
        System.out.println(retN.val);

        System.out.println("====层序遍历====");
        testBinaryTree.levelOrder(root);

        /*Queue<TestBinaryTree.TreeNode > queue = new LinkedList<>();
        queue.offer(null);
        queue.offer(null);
        queue.offer(null);
        System.out.println(queue.size());*/
        System.out.println("====测试是否是满二叉树====");
        System.out.println(testBinaryTree.isCompleteTree(root));
    }

}
